<?php 
$objVendor = Vendor::model()->getModel('VENDOR-ID',array('vendorID'=>$data->vendorID));
$userID = ApplicationSessions::run()->read('userID');
$jobApp = JobApplication::model()->getModel("JOB-APPLICANT-ID", array('jobID'=>$data->jobID,'applicantID'=>$userID,'vendorID'=>$objVendor->vendorID));
if (empty($jobApp)){
?>
<div class="view">
	<b><?php echo "Job Code"; ?>:</b>
	<?php echo CHtml::encode($data->jobID); ?>
	<br />
	<br />
	<b><?php echo "Job Details"; ?>:</b><br/>
	<?php 
	
	echo "   <b>Company Name: </b>".$objVendor->vendor_name."<br/>"; 
	?>
	<?php 
	$jobID = $data->jobID;
	$objJob = Job::model()->getModel('JOB-ID',array('jobID'=>$jobID));
	echo "<b>$objJob->job_title <br/>Type: </b>".ApplicationConfig::app()->params['job_params']['type'][$objJob->job_type].",   "."<b>Location: </b>";
	echo City::model()->getModel("BY-ID", array('id'=>$objJob->job_location_cityID))->city_name.", ".State::model()->getModel("BY-ID", array('id'=>$objJob->job_location_stateID))->state_name;
	echo "   <b>Salary: </b>".$objJob->salary.",   "."<b>Qualification: </b>".$objJob->qualification.",   "."<b>Position: </b>".$objJob->position.""; 
	?>
	<br />
	<br />
	<?php 
		
		echo "<div id='applydiv$data->jobID'>";
			echo CHtml::ajaxButton(
				'Apply',
				ApplicationConfig::getURL("","myOffer","jobApplication",array('jobID'=>$data->jobID,'userID'=>$userID,'vendorID'=>$objVendor->vendorID)),
				array('update'=>'#applydiv'.$data->jobID),
				array('id'=>'apply'.$data->jobID)
			);
		echo "</div>";
		 ?>
	<br />
	<br /><hr/>

</div>
<?php }?>